#include "03_header.h"
//发送小火车包含指令字符串，指令类型
int sendRequest(int sockfd, const char *request, int type){
    train_t train;
    bzero(&train, sizeof(train_t));
    train.type = type;
    train.lenth = strlen(request);
    strcpy(train.value, request);
    int ret = send(sockfd, &train, sizeof(int) + sizeof(int) + train.lenth, MSG_NOSIGNAL);
    if(ret == -1){
        return -1;
    }
    return 0; 
}
